<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>客户留言</title>
		<style type="text/css">
<!--
.c1 {
	font-size: 13px;
	color: #FFFFFF;
}

.c2 {
	font-size: 13px;
	font-weight: bold;
	color: #FFFFFF;
}

.title {
	font-size: 15px;
	color: #1B3E6D;
	line-height: 18pt;
	font-weight: bold;
}
-->
</style>
		<link href="css/c1.css" rel="stylesheet" type="text/css">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		<link href="css/front.css" rel="stylesheet" type="text/css">
		<link href="css/guestbook.css" rel="stylesheet" type="text/css">
	</head>
<script type="text/javascript">
function gbcount(message,total,used,remain) {
 	var max;
	max = total.value;
	if (message.value.length > max) {
		message.value = message.value.substring(0,max);
		used.value = max;
		remain.value = 0;
		alert("留言不能超过 300 个字!");
	} else {
		used.value = message.value.length;
		remain.value = max - used.value;
	}
}
</script>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<jsp:include page="top.jsp" />

		<table width="1004" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="484" align="center">
					<table width="98%" height="528" border="0" align="center"
						cellpadding="0" cellspacing="0">
						<tr>
							<td width="192" height="528" valign="top">
								<jsp:include page="left.jsp" />
							</td>
							<td align="center" valign="top">
								<table width="700" border="0" cellpadding="0" cellspacing="0">
									<tr background="image/page/mean_bg.jpg">
										<td height="40" background="image/page/mean_bg.jpg">
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<img src="image/page/arr.jpg" width="14" height="6">
											<span class="title">&nbsp;客户留言</span>
										</td>
									</tr>
									<tr>
										<td align="center" valign="top" width="100%">
											<table width="100%" border="0" cellpadding="0"
												cellspacing="0" style="color: #333">
												<tr>
													<td height="31">
														&nbsp;
													</td>
													<td>
														<div style="color: #f00">
															${ request.error }
														</div>
													</td>
													<td>
														<DIV id="gbook_content">
														<!--留言列表Begin-->
														<c:forEach items="${ request.messages }" var="message">
															<DIV class="gbook_msg_list">
																<DIV class="msg_bar">
																	<DIV class="gbook_usrname">
																		<IMG border="0" align="absMiddle"
																			src="image/page/question.gif">
																		&nbsp;
																		<c:choose>
																			<c:when test="${empty message.MName }">匿名</c:when>
																			<c:otherwise>${ message.MName }</c:otherwise>
																		</c:choose>
																	</DIV>
																	<DIV class="msg_time">
																		<fmt:formatDate value="${ message.MTime }"
																			pattern="yyyy-MM-dd HH:mm:ss" />
																	</DIV>
																</DIV>
																<DIV class="msg_content">
																	&nbsp;&nbsp;&nbsp;&nbsp;${ message.MContent }
																</DIV>
																<c:if test="${ !empty message.messages }">
																	<c:forEach items="${ message.messages }" var="msg">
																		<DIV class="reply_content">
																			<div class="msg_bar">
																			<DIV class="gbook_answer">
																				<IMG border="0" align="absMiddle"
																					src="image/page/answer.gif">管理员${ msg.admin.adminName }
																				&nbsp;为您解答:
																			</DIV>
																			<DIV class="msg_time">
																				<fmt:formatDate value="${ msg.MTime }"
																					pattern="yyyy-MM-dd HH:mm:ss" />
																			</DIV>
																			<br/>
																			
																		</DIV>
																			&nbsp;&nbsp;&nbsp;&nbsp;${ msg.MContent }
																			</DIV>
																	</c:forEach>
																</c:if>
															</DIV>
														</c:forEach>
													</DIV>
													</td>
												</tr>
												<tr>
													<td colspan="3">
														<table width="100%" border="0" cellspacing="0"
															cellpadding="5">
															<tr valign="middle">
																<td>
																	<div align="center" class="pagebar">
																		${ request.pageuri }
																	</div>
																</td>
															</tr>
														</table>
													</td>
												</tr>
												<tr>
													<td height="31">
														&nbsp;
													</td>
													<td>
														&nbsp;
													</td>
													<td height="260" valign="top">

														<form name="form1" method="post" action="liveMessage.action">
															<table width="100%" height="323" border="0" align="center"
																cellpadding="0" cellspacing="1" style="MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px" bgColor="#7dbfdb"
																class="c1">
																<tr>
																	<td bgColor="#7dbfdb" height="25" align="left">&nbsp; <IMG border="0" alt="" 
				     	 												align="absMiddle" src="image/page/liuyan.gif"  width="14" height="12"> 
				     	 												<strong>我 要 留 言</strong>
				     	 											</td>
																</tr>
																<tr class="texthei">
																	<td width="153" height="135" align="right" valign="top"
																		bgcolor="#FFFFFF">
																		<font color="#333333"><br> <br> <br>
																			<br> 留言内容： </font>
																	</td>
																	<td colspan="3" bgcolor="#FFFFFF">
																	<input type="hidden"
																				name="message.MName" class="input1" id="companyName"
																				size="25" maxlength="50"
																				value="${ session.user.UName }" />
																		<input type="hidden"
																				name="message.MMobile" class="input1" id="tel"
																				size="25" maxlength="13"
																				value="${ session.user.mobile }" />
																		<input type="hidden"
																				class="input1" maxlength="50" name="message.MEmail"
																				size="25" value="${ session.user.email }" />
																		<font color="#333333"> &nbsp; <textarea
																				name="message.MContent" cols="60" rows="8"
																				class="input1" id="content"
																				onKeyDown="gbcount(this.form.content,this.form.total,this.form.used,this.form.remain);"
																				onKeyUp="gbcount(this.form.content, this.form.total, this.form.used, this.form.remain);"></textarea><br/>
																				最多字数： <input disabled="disabled" maxLength="4" id="total" size="3" value="300" class="input1"> 
																				已用字数： <input disabled="disabled" maxLength="4" id="used" size="3" value="0" class="input1"> 
																				剩余字数： <input disabled="disabled" maxLength="4" id="remain" size="3" value="300" class="input1">
																		</font>
																	</td>
																</tr>
																<tr class="texthei">
																	<td style="LINE-HEIGHT: 20px; color: #333;" align="left" colspan="4" bgcolor="#FFFFFF">
																		&nbsp;&nbsp;1.用户发表留言仅代表其个人意见，并且承担一切因发表内容引起的纠纷和责任;
																		<br />
																		&nbsp;&nbsp;2.本站管理人员有权在不通知用户的情况下删除不符合规定的留言信息或留做证据;
																		<br />
																		&nbsp;&nbsp;3.请客观的评价您所看到的资讯，提倡就事论事，杜绝漫骂和人身攻击等不文明行为.
																	</td>
																</tr>
																<tr class="texthei">
																	<td colspan="4" align="right" valign="top"
																		bgcolor="#FFFFFF">
																		<div align="center">
																			<input class="input1" type="submit" value="立刻发送" />
																			<input class="input1" type="reset" value="重新填写" />
																			<br />
																			<img height="1" src="" width="400" />
																		</div>
																	</td>
																</tr>
															</table>
														</form>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<jsp:include page="bottom.jsp" />

	</body>
</html>
